package com.bbcare.exportExcel.plat.entity;	

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

/**
 * @name:问题	
 * @author:	
 * @createTime: 
 */	
	
@Entity	
@Table(name="t_question")	
public class Question {	
	
	@Id	
	@GenericGenerator(name="systemUUID",strategy="uuid")	
	@GeneratedValue(generator="systemUUID")	
	@Column(name="_id")
	private String id;
	
	//分数	
	@Column(name="_sorce")
	private Integer sorce;	
	
	//问题类型	
	@Column(name="_type")
	private String type;	//1、单选题   2、判断题      3、问答题      4、多选题               5、单选有单位            6、日期选择             7、数字选择                8、双选选择		9、数字填写题
	
	//上一题Id	
	@Column(name="_lastId")
	private String lastId;	//当未第一个问题时设置lastId 为"-1"
	
	//下一题Id	
	@Column(name="_nextId")
	private String nextId;	
	
	//上一题
	@Column(name="_lastName")
	private String lastName;
	
	//下一题
	@Column(name="_nextName")
	private String nextName;
	
	//关联类型	
	@Column(name="_relaType")
	private String relaType;	//1、问题关联   2、选项关联
	
	//问题描述	
	@Column(name="_note")
	private String note;	
	
	//附件路径类型	
	@Column(name="_filePathType")
	private String filePathType;	// 1、服务器路径   2、本地路径
	
	//附件路径	
	@Column(name="_filePath")
	private String filePath;
	
	//附件类型
	@Column(name="_fileType")
	private String fileType;	//1、图片	2、动画
	
	//创建时间	
	@Column(name="_createTime")
	private Date createTime;	
	
	//包含宝宝问卷详情
	@OneToMany(mappedBy="question")
    private List<BabyQuestionDetail> babyQuestionDetails;
	
	//包含问题选项
	@OneToMany(mappedBy="question",fetch=FetchType.EAGER)
    private List<Options> optionss;
	
	//所属问卷
	@ManyToOne
    @JoinColumn(name="_questionnaire_id")
    private Questionnaire questionnaire;
    
    //关联问卷名称
	@Column(name="_questionnaire_name")
    private String questionnaireName;
	
	@Transient
	private String answer;
	
	//问题模块Id
	@Column(name="_questionModuleId")
	private String questionModuleId;
	
	//问题模块名称
	@Column(name="_questionModuleName")
	private String questionModuleName;
	
	//问题单位
	@Column(name="_unit")
	private String unit;
	
	@Column(name="_developProjectId")
	private String developProjectId;
	
	//限定最大值
	@Column(name="_limitmax")
	private String limitmax;
	
	//限定最小值
	@Column(name="_limitmin")
	private String limitmin;
	
	//限定精度
	@Column(name="_limitaccuracy")
	private String limitaccuracy;
	
	//限定备注
	@Column(name="_limitnote")
	private String limitnote;
	
	//提示语
	@Column(name="_placeholder")
	private String placeholder;
	
	@Column(name="_subnote")
	private String subnote;
	
	//音频路径
	@Column(name="_audioPath")
	private String audioPath;
	
	public String getId() {	
		return id;	
	}	
	
	public void setId(String id) {	
		this.id = id;	
	}
	
	public Integer getSorce() {	
		return sorce;	
	}	
	
	public void setSorce(Integer sorce) {	
		this.sorce = sorce;	
	}
	
	public String getType() {	
		return type;	
	}	
	
	public void setType(String type) {	
		this.type = type;	
	}
	
	public String getLastId() {	
		return lastId;	
	}	
	
	public void setLastId(String lastId) {	
		this.lastId = lastId;	
	}
	
	public String getNextId() {	
		return nextId;	
	}	
	
	public void setNextId(String nextId) {	
		this.nextId = nextId;	
	}
	
	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getNextName() {
		return nextName;
	}

	public void setNextName(String nextName) {
		this.nextName = nextName;
	}

	public String getRelaType() {	
		return relaType;	
	}	
	
	public void setRelaType(String relaType) {	
		this.relaType = relaType;	
	}
	
	public String getNote() {	
		return note;	
	}	
	
	public void setNote(String note) {	
		this.note = note;	
	}
	
	public String getFileType() {
		return fileType;
	}

	public void setFileType(String fileType) {
		this.fileType = fileType;
	}

	public String getFilePathType() {	
		return filePathType;	
	}	
	
	public void setFilePathType(String filePathType) {	
		this.filePathType = filePathType;	
	}
	
	public String getFilePath() {	
		return filePath;	
	}	
	
	public void setFilePath(String filePath) {	
		this.filePath = filePath;	
	}

	public Date getCreateTime() {	
		return createTime;	
	}	
	
	public void setCreateTime(Date createTime) {	
		this.createTime = createTime;	
	}
	
	public List<BabyQuestionDetail> getBabyQuestionDetails() {	
		return babyQuestionDetails;	
	}
	
	public void setBabyQuestionDetails(List<BabyQuestionDetail> babyQuestionDetails) {	
		this.babyQuestionDetails = babyQuestionDetails;	
	}
	
	public List<Options> getOptionss() {	
		return optionss;	
	}
	
	public void setOptionss(List<Options> optionss) {	
		this.optionss = optionss;	
	}
	
	public Questionnaire getQuestionnaire() {	
		return questionnaire;	
	}
	
	public void setQuestionnaire(Questionnaire questionnaire) {	
		this.questionnaire = questionnaire;	
	}
	
	public String getQuestionnaireName() {	
		return questionnaireName;	
	}
	
	public void setQuestionnaireName(String questionnaireName) {	
		this.questionnaireName = questionnaireName;	
	}

	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public String getQuestionModuleId() {
		return questionModuleId;
	}

	public void setQuestionModuleId(String questionModuleId) {
		this.questionModuleId = questionModuleId;
	}

	public String getQuestionModuleName() {
		return questionModuleName;
	}

	public void setQuestionModuleName(String questionModuleName) {
		this.questionModuleName = questionModuleName;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public String getDevelopProjectId() {
		return developProjectId;
	}

	public void setDevelopProjectId(String developProjectId) {
		this.developProjectId = developProjectId;
	}

	public String getLimitmax() {
		return limitmax;
	}

	public void setLimitmax(String limitmax) {
		this.limitmax = limitmax;
	}

	public String getLimitmin() {
		return limitmin;
	}

	public void setLimitmin(String limitmin) {
		this.limitmin = limitmin;
	}

	public String getLimitaccuracy() {
		return limitaccuracy;
	}

	public void setLimitaccuracy(String limitaccuracy) {
		this.limitaccuracy = limitaccuracy;
	}

	public String getLimitnote() {
		return limitnote;
	}

	public void setLimitnote(String limitnote) {
		this.limitnote = limitnote;
	}

	public String getPlaceholder() {
		return placeholder;
	}

	public void setPlaceholder(String placeholder) {
		this.placeholder = placeholder;
	}

	public String getSubnote() {
		return subnote;
	}

	public void setSubnote(String subnote) {
		this.subnote = subnote;
	}

	public String getAudioPath() {
		return audioPath;
	}

	public void setAudioPath(String audioPath) {
		this.audioPath = audioPath;
	}
}